As expected, the multiplication '*' and division '/' operators have precedence over the addition '+' and subtraction '-' operators. The modulus operator '%' produces the remainder when its integer operands divide each other. No exponentiation operator is provided. The standard math library function pow() serves this purpose*.
One source of occasional programming errors is that arithmetic operations involving only integer values produce an integer result. In the following example, the float variable f is initialized with the value 0 whereas g is assigned 0.5 (recall that constants must contain a decimal point to be considered as floating-point numbers).
float f = 1/2; /* assigns 0 to f */
float g = 1./2.;
The unary (one-operand) negation operator '-' has higher precedence than the foregoing operators, as do the unary increment '++' and decrement '--' operators. These last operators are a shorthand for assigning the value of a variable incremented or decremented by 1 to the same variable. As with other assignment operators, the change to the value of the variable is considered a "side effect", since